<div class="panel panel-default" ng-controller="AgencyOrderCtrl">
	<div class="panel-heading">
		代售业务 / 代售业务统计
	</div>
	<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
							<ui-select-match placeholder="订单状态">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="status in statusList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" status.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined"
								class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
						</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.startTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="开始时间" readOnly /> <span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.endTime" datepicker-options="dateOptions"
							close-text="Close" placeholder="结束时间" readOnly /> <span class="input-group-btn">
							<button type="button" class="btn btn-default"
								ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" has-authority="BOOKING">
				<div class="col-md-12">
					<div class="input-group">
						<ui-select ng-model="agencyList.selected" theme="bootstrap">
							<ui-select-match placeholder="选择代售点">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="agency in agencyList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" agency.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="agencyList.selected = undefined" class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-2">
				<div class="col-md-6">
					<button type="button" class="btn btn-info" ng-click="query()">查询</button>
				</div>
				<div class="col-md-6">
					<button type="button" class="btn btn-info" ng-click="total()">订单汇总</button>
				</div>
			</div>
		</form>
	</div>
	<div class="row m-n" ng-show="flag">
		<p class="m-l-lg">
			当前总共：{{totalCount}}个订单 &nbsp; 订单总金额：{{orderTotal |number:2}} &nbsp;
			订单应付总金额：{{orderPaymentTotal |number:2}} &nbsp; 退款总金额：{{orderRefundToatal |number:2}} &nbsp;
			保险总金额：{{insuranceTotal |number:2}} &nbsp; 车票总数：{{ticketCount}} &nbsp;
			<br/>
			电子客票应付总金额：{{imOrderPaymentTotal |number:2}} &nbsp;
			电子客票退款总金额：{{imOrderRefundToatal}} &nbsp; 支付流水数：{{paymentCount}} &nbsp; 总收入：{{priceTotal | number:2}}
		</p>
	</div>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th style="width: 20px;"></th>
					<th>代售点</th>
					<th>下单日</th>
					<th>订单数</th>
					<th>订单总金额</th>
					<th>订单应付总金额</th>
					<th>退款总金额</th>
					<th>保险总金额</th>
					<th>车票总数</th>
					<th>电子客票应付总金额</th>
					<th>电子客票退款总金额</th>
					<th>支付流水笔数</th>
					<th>总收入</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="order in dataList">
					<td></td>
					<td>{{order[0]}}</td>
					<td>{{order[1]}}</td>
					<td>{{order[2]}}</td>
					<td>{{order[3] | number:2}}</td>
					<td>{{order[4] | number:2}}</td>
					<td>{{order[5] | number:2}}</td>
					<td>{{order[6] | number:2}}</td>
					<td>{{order[7]}}</td>
					<td>{{order[8] | number:2}}</td>
					<td>{{order[9] | number:2}}</td>
					<td>{{order[10]}}</td>
					<td>{{order[11] | number:2}}</td>
				</tr>
				<tr ng-show="dataList==''">
					<td colspan="12" style="text-align: center;">暂无代售点业务信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer/>
</div>